<template>
    <LayoutWrap class="transcations-history">
        <el-tabs value="history" type="card">
            <el-tab-pane name="history">
                <template v-slot:label>
                    <span class="history">上传支付宝交易记录明细历史列表</span>
                </template>
                <el-table :data="tableHistoryData" border>
                    <template v-for="item in columnHistoryData">
                        <el-table-column :key="item.key" :prop="item.prop" :label="item.label"></el-table-column>
                    </template>
                    <el-table-column key="operation" prop="operation" label="操作">
                        <template v-slot="scope">
                            <el-button type="primary" @click="handleHistoryDownload(scope)">下载</el-button>
                            <el-button type="danger">删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>
                <Pagination
                    :page-size.sync="formHistory.pageSize"
                    :page.sync="formHistory.page"
                    :total="formHistory.count"
                />
            </el-tab-pane>
        </el-tabs>
    </LayoutWrap>
</template>
<script>
export default {
    name: 'transcations-history',
    data() {
        return {
            formHistory: {
                count: 0, // 总条数
                pageSize: 10, // 一页多少条
                page: 1 // 当前第几页
            },
            // tableHistoryData
            // 导入成功的历史纪录
            tableHistoryData: [
                {
                    Account: '支付宝: 18203275891',
                    Filename: '查询明细',
                    UploadTime: '20201031 11:41'
                }
            ],
            columnHistoryData: [
                {prop: 'Account', label: '账号', key: 'Account'},
                {prop: 'Filename', label: '文件名称', key: 'Filename'},
                {prop: 'UploadTime', label: '上传时间', key: 'UploadTime'}
            ]
        };
    },
    methods: {
        handleHistoryDownload({$index: index, row}) {
            console.log('index', index);
            console.log('row', row);
        }
    }
};
</script>
